'use strict'

class  dongtai{
  
  constructor () {

  }

  makeId () {
    return `u_${Date.now().toString(16)}${parseInt(Math.random()*10000) + 11111}`
  }

  //得到动态列表
  async list (c) {
    let wuser = c.service.model.dongtai
    let ulist = await wuser.list()
    c.send(ulist)
  }

  //删除数据
  async delete(c){
    // console.log(c.param.id)
    let wuser = c.service.model.dongtai
    await wuser.delete(c.param.id)
  }

  async update(data,id){
    // console.log(data)
    // console.log(id)
    await this.model().where({id}).update(data)
  }
}

module.exports = dongtai